package Controller;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@SpringBootApplication
@MapperScan(basePackages = {"mapper"}) // 自动扫描
@ComponentScan(basePackages = {"schedule","redis"})
@EnableScheduling
@EnableAutoConfiguration
@EnableTransactionManagement//启用事物管理,在service上使用@Transactional（注意是spring的 注解）
public class Application {
//    static String classPath = new Application().getClass().getClassLoader().getResource("")+"";


    /*@Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application){
        return application.sources(Application.class);
    }*/


    public static void main(String[] args) {

        SpringApplication.run(Application.class, args);
//        System.out.println("classpath: "+classPath);

        System.out.println("spring boot 启动成功！");
    }
}
